package com.sskj.api.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.time.LocalDateTime;

@Data
@Schema(description = "项目")
@TableName("project")
public class Project {

    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    @Schema(description = "项目名称")
    @NotBlank(message = "项目名称不能为空")
    private String name;

    @Schema(description = "项目描述")
    private String description;

    @NotNull(message = "负责人不能为空")
    @Schema(description = "负责人")
    @TableField("leader_id")
    private Long leaderId;

    @Schema(description = "负责人名称")
    @TableField(exist = false)
    private String leaderName;

    @NotBlank(message = "客户名称不能为空")
    @Schema(description = "客户名称")
    private String clientName;

    @Schema(description = "项目地址")
    private String address;

    @Schema(description = "项目状态[0-已关闭|1-进行中|2-暂停|3-已完成|4-延期]")
    private Integer status;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    private LocalDateTime createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("update_time")
    private LocalDateTime updateTime;
}
